//
//  CommonDefine.h
//  FuZhu
//
//  Created by app on 2017/9/14.
//  Copyright © 2017年 王文. All rights reserved.
//

#ifndef CommonDefine_h
#define CommonDefine_h

#define kWidth [UIScreen mainScreen].bounds.size.width
#define kHeight [UIScreen mainScreen].bounds.size.height

#define kWidthScale (float)375/KWidth
#define kHeightScale (float)667/kHeight

#define USHARE_DEMO_APPKEY @"5861e5daf5ade41326001eab"

//判断是否为5代以上尺寸
#define isGTPhone5     kWidth > 320.0
#define fontSize(size) [UIFont systemFontOfSize:size]
#define selfont1 isGTPhone5?18:17  // 1级字体大小     导航栏标题字体
#define selfont2 isGTPhone5?16:15  // 2级字体大小     内容文字
#define selfont3_5 isGTPhone5?15:14// 3.5级字体大小   列表内容文字
#define selfont3 isGTPhone5?13:12  // 3级字体大小
//#define selfont4_5 26*WidthScale  // 4.5级字体大小
#define selfont4 isGTPhone5?12:11  // 4级字体大小

#define APPDELEGATE ((AppDelegate *)([[UIApplication sharedApplication] delegate]))
#define NAVH 44 //导航栏高度
#define STATUSH [[UIApplication sharedApplication] statusBarFrame].size.height//状态栏高度
#define TABH APPDELEGATE.tabBarVC.tabBar.bounds.size.height//tabbar高度

#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]


#define Device_Is_iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)

#ifdef DEBUG
#define ICLog(format, ...)    NSLog(format, ##__VA_ARGS__)
#else
#define ICLog(format, ...)
#endif

#define FxLog(...) NSLog(@"%s 第%d行 \n %@\n\n",__func__,__LINE__,[NSString stringWithFormat:__VA_ARGS__])
#else
#define FxLog(...)

#endif /* CommonDefine_h */
